#! /bin/sh
# Print colorschemes that should be removed

# First, go to the right directory...
dirok() { test -d colors ; }
for i in 1 2 3 4 5 6 7 8 ; do
        dirok || cd .. || exit
done
dirok || { echo>&2 botched directory; exit 123; }

exception() {
        for e in  \
                distinguished.vim \
                gotham256.vim \
                gotham.vim \
                hybrid-light.vim \
                last256.vim \
                primary.vim \
                random.vim \
                seoul256-light.vim \
                ; do
                test colors/"$e" = "$1" && return 0
        done
        false
}
for colo in colors/*.vim ; do
        egrep 'hi.*(term|gui)' >/dev/null "$colo" && continue
        exception "$colo" || echo "$colo" || exit
done
